﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.ComponentModel.Composition;
using System.Windows.Input;

namespace ShredTheLog.Converters
{
    [ValueConversion(typeof(KeyGesture), typeof(bool))]
    public sealed class MessageCanContainCRConverter : ConverterBase, IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var v = (KeyGesture)value;
            return v == null || v.Key != Key.Enter || v.Modifiers != ModifierKeys.None;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }

        public static readonly MessageCanContainCRConverter Default = new MessageCanContainCRConverter();
    }
}
